<template>
  <div>
    <p>{{ msg }}</p>
    <input type="text" v-model="msg" />
  </div>
</template>

<script setup lang="ts" name="">
import { customRef, ref } from "vue";
//使用vue提供的默认ref定义响应式数据，数据一变，页面就立即更新
// let msg = ref("您好");
//需求，输入框变化，要等一会儿再变化，如何实现？
import useCustRef from "@/hooks/useCustomRef";
let { msg } = useCustRef("您好", 1000);
console.log(msg);
console.log({ msg });
</script>

<style scoped></style>
